package com.kede.app.converenum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:
 ** @Date: create in 2023/5/23 16:04
 ***/
@Getter
@AllArgsConstructor
public enum GoodTypeConverEnum implements PersistEnum2DB<Integer,Integer>{
    ENTITY(0,"实物",1),
    VIRTUAL(1,"虚拟",2),
    DEBI(2,"德币",3);

    private Integer code;
    private String value;
    private Integer index;

    @Override
    public Integer toColType() {
        return index;
    }

    @Override
    public Integer toEnumCode() {
        return code;
    }

    public static class Converter extends AbstractEnumConverter<GoodTypeConverEnum,Integer,Integer>{
        public Converter() {
            super(GoodTypeConverEnum.class);
        }
    }
}
